﻿#ifndef SCALEDSHAPEBASEDMATCHING_H
#define SCALEDSHAPEBASEDMATCHING_H

#include "line2Dup.h"
#include "shape_based_matching/ShapeBasedMatching.h"

namespace Qly
{

class ScaledShapeBasedMatching : public ShapeBasedMatching
{
public:
    ScaledShapeBasedMatching();
    bool trainModel(cv::Mat modelImg, float min_scale, float max_scale, int num_scale, int num_features);
    bool saveModel(std::string path, std::string modelName) override;
    bool loadModel(std::string path, std::string modelName) override;
    std::vector<MatchResult> runMatch(const cv::Mat &img, float score, size_t maxCount = 1) override;
private:
    cv::Rect boundRect(const line2Dup::Match &match, float scale = 1);
    float scale(const line2Dup::Match &match);
};
}
#endif // SCALEDSHAPEBASEDMATCHING_H
